<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script language="javascript">
        var userName = prompt("请输入您的名字","yourname");
        document.write("您的名字是:" + userName);
    </script>
       
</body>
</html>